package cn.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;

import cn.pojo.Sort;
import cn.service.SortService;

@Controller
@RequestMapping("/sort")
public class SortController {
	@Resource
	private SortService sortService;

	@RequestMapping(value = "/getSort", produces = "application/json;charset=utf-8")
	@ResponseBody
	public String getSort(HttpServletRequest request, HttpServletResponse response, Model md) {
		List<Sort> list = sortService.getSort();
		return JSON.toJSONString(list);
	}
}
